<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 300px;
            height: 320px;
            border: 5px solid red;
            border-left: 10px solid red;
            margin: 0 auto;
        }

        #d {
            width: 300px;
            height: 100px;
            color: red;
            font-size: 20px;
            text-align: center;
            line-height: 100px;
        }

        #top {
            height: 40px;
            width: 300px;
            text-align: center;
            opacity: 0.5;
        }

        #but {
            height: 40px;
            width: 300px;
            text-align: center;
            opacity: 0.5;
        }

        #rig {
            width: 240px;
            height: 30px;
            opacity: 0.5;
            text-align: right;
        }

        #foot {
            height: 40px;
            width: 300px;
            text-align: center;
            opacity: 0.5;
            line-height: 40px;
        }

        #foot #fot {
            background-color: red;
            text-align: center;
            color: #fff;
        }


        .box2 {
            width: 300px;
            height: 30px;
            margin-left: 630px;
        }
    </style>
</head>

<body>
    <div id="box">
        <div id="d">注册账号</div>
        <div id="top">
            <input type="text" placeholder="手机号/qq号/微信号" id="txt1">
            <span class="pd"
                style="font-size: 14px; width:50px; height: 30px; color: #000; background-color: #fff;"></span>
        </div>

        <div id="rig">
            <input type="text" placeholder="设置密码" id="txt2">
            <span class="pd" style="font-size: 14px; color: #000; background-color: #fff;"></span>
        </div>
        <div id="foot">
            <input type="button" value="注册" id="fot">

        </div>
    </div>
</body>

</html>
<script src="../js/jquery.js"></script>
<script src="../js/tool.js"></script>
<script>
    $('#fot').on("click", function () {
        console.log();
        $.post('../images/php/addUser.php',
            { "username": $('#txt1').val(), "userpass": $('#txt2').val() },
            function (data) {
                console.log(data);
                location.href='./02dengluye.html';
            })
    })
</script>